Skip to content

Conversation

@itsdouges
Copy link
Contributor

@itsdouges itsdouges commented Nov 7, 2025

  • adds axes.json which has variable font axes definitions
  • adds axes to metadata.json
  • updates fonts.json to include variants and axes if defined

we'll want to copy fonts.json, axis.json, and the updated font-chunk.avifs into paper

Copy link
Contributor

@vladmoroz vladmoroz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • We need axes min/default/max per font, as they vary. Not sure why Google stores global min/default/max for each axis.
  • We can reduce the axes registry to an object "TAG": "Display name"
    • precision is nice but looks like we can drop it too since we don't have access to that with local fonts, so we'd need to implement a general-purpose heuristic to determine precision either way (font files don't carry this info)

Copy link
Contributor

@vladmoroz vladmoroz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's also sort the axes in the font metadata same way we are going to do it in the app

@itsdouges
Copy link
Contributor Author

Ok will adjust

"Zilla Slab Highlight": {"x":166,"y":768,"w":225,"ch":16,"s":["400","700"]}
"ABeeZee": {"x":0,"y":0,"w":168,"ch":0,"s":{"v":["400","400i"]}},
"ADLaM Display": {"x":157,"y":64,"w":219,"ch":0,"s":{"v":["400"]}},
"AR One Sans": {"x":0,"y":704,"w":244,"ch":0,"s":{"v":["400","500","600","700"],"a":[{"tag":"wght","min":400,"max":700},{"tag":"ARRR","min":10,"max":60}]}},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason to change styles "s" key to "v" inside "s"? prefer flatter objects

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok will bring them out

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need the "s" → "v" rename too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah right might as well revert that, will do!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@vladmoroz
Copy link
Contributor

We need axes min/default/max per font, as they vary

oh one more before we can merge, we still need default for each font's the axis. in Paper we still are going to store it, just not in our Axis object, but as the coordinate on Font instance itself when that's created.

@itsdouges
Copy link
Contributor Author

I'll take a look

@itsdouges
Copy link
Contributor Author

itsdouges commented Nov 10, 2025

@vladmoroz

  • added axes min/max/default values to the metadata.json / fonts.json
  • all of the "Material Symbols" fonts had missing axes data so I had to collect it from both font APs

coordinates is still missing in this data, is that a problem? I'm not 100% sure what they are

The instance record format includes a UserTuple record that specifies a position within the font’s variation space. The UserTuple record has an array of user scale coordinates:

🤔

@vladmoroz
Copy link
Contributor

added axes min/max/default values to the metadata.json / fonts.json

looks good!

all of the "Material Symbols" fonts had missing axes data so I had to collect it from both font APs

huh would we have to keep track of it manually when we regenerate fonts.json? if yes, maybe we hardcode that specific axis data should be added

coordinates is still missing in this data, is that a problem? I'm not 100% sure what they are

that's fine, we'll construct them manually at runtime when a font is requested using the data we have here. they describe variable font instances but Google Fonts doesn't seem to have a concept of variable instances at all.

@itsdouges
Copy link
Contributor Author

huh would we have to keep track of it manually when we regenerate fonts.json? if yes, maybe we hardcode that specific axis data should be added

No it's automatic

@vladmoroz vladmoroz merged commit da96f83 into initial-build Nov 14, 2025
@hugosaintemarie hugosaintemarie deleted the variable-fonts branch November 17, 2025 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants